using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ControlPaint.DrawFocusRectangle(Graphics.FromHwnd(this.button2.Handle), button2.ClientRectangle);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            SYSTEM_INFO pSI = new SYSTEM_INFO();

            GetSystemInfo(ref pSI);

            this.label1.Text = pSI.dwProcessorType.ToString();
        }

        public struct SYSTEM_INFO
        {
            public uint dwOemId;

            public uint dwPageSize;

            public uint lpMinimumApplicationAddress;

            public uint lpMaximumApplicationAddress;

            public uint dwActiveProcessorMask;

            public uint dwNumberOfProcessors;

            public uint dwProcessorType;

            public uint dwAllocationGranularity;

            public uint dwProcessorLevel;

            public uint dwProcessorRevision;
        }

        [DllImport("kernel32")]

        static extern void GetSystemInfo(ref SYSTEM_INFO pSI);
    }
}